/**
 * Created by dell on 2018/12/12.
 */
/**
 * Created by dell on 2018/12/11.
 */
var equipmentData = {};	// 用来存储物体集合

var bootstrapTableOption = {
    url: 'getChargingStateList',
    queryParams: function (params) {
        return {
        }
    },
    columns: [
        {title: '序号', align: 'center', formatter: 'increases'},
        {field: 'chargingStationID', title: '站编号'},
        {field: 'chargingStationName', title: '充电站名称'},
        {field: 'communicateStatus', title: '通讯状态'},
        {field: 'onlineEquipmentNumber', title: '在线桩数量'},
        {field: 'offlineEquipmentNumber', title: '离线桩数量'},
        {field: 'updateDTTM', title: '更新时间', type:"date2String"}
    ],
    responseHandler: function (data) {
        equipmentData = data.list;
        return data;
    }
};

/* 根据查询条件获取充电站信息 */
function search() {
    $('#chargingstateTable').bootstrapTable('selectPage', 1);
}

$(document).ready(function () {
    setBootstrapTable('#chargingstateTable', bootstrapTableOption);
});

function setBootstrapTable(id, bootstrapTableOption) {
    $(id).bootstrapTable(
        $.extend(true,
            {
                url: undefined,
                queryParamsType: '',
                queryParams: function (params) { return params;},
                dataField: 'list',
                columns: [[]],
                paginationLoop: false,
                striped: true,
                pagination: true,
                sidePagination: 'server',
                pageSize: 10,
                pageList: [5, 10, 25, 50, 100],
                paginationPreText: "上一页",
                paginationNextText: "下一页",
                buttonsClass: 'select'},
            bootstrapTableOption
        )
    );
}

/* 操作 */
function showSave() {
    alert("操作");
}

/* 重置 */
function reset() {
    alert("重置");
}



